package org.alps.pattern.singleton;

import org.alps.pattern.singleton.lazy.LazyDoubleCheckSingleton;
import org.alps.pattern.singleton.lazy.LazySimpleSingleton;
import org.alps.pattern.singleton.threadlocal.ThreadLocalSingleton;

/**
 * @date 2021-04-30
 * @author zkw
 */
public class ExecutorThread implements Runnable {
    @Override
    public void run() {
        //LazySimpleSingleton singleton = LazySimpleSingleton.getInstance();
        //LazyDoubleCheckSingleton singleton = LazyDoubleCheckSingleton.getInstance();
        ThreadLocalSingleton singleton = ThreadLocalSingleton.getInstance();
        System.out.println(Thread.currentThread().getName() + ":" + singleton);

        System.out.println(Thread.currentThread().getName() + ":" + ThreadLocalSingleton.getInstance());
        System.out.println(Thread.currentThread().getName() + ":" + ThreadLocalSingleton.getInstance());
        System.out.println(Thread.currentThread().getName() + ":" + ThreadLocalSingleton.getInstance());
        System.out.println(Thread.currentThread().getName() + ":" + ThreadLocalSingleton.getInstance());

    }
}
